﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace CompessjQueryClient
{
    class Program
    {
        static void Main(string[] args)
        {
            GoogleClosure gc = new GoogleClosure();

            string path = args[0];
            if (!path.EndsWith("\\"))
                path += "\\";

            foreach (string file in System.IO.Directory.GetFiles(path))
            {
                if (file != path + "jTemplates.js")
                {
                    if (file.EndsWith(".js") && !file.EndsWith(".min.js"))
                    {
                        File.WriteAllText(file.Substring(0, file.Length - 3) + ".min.js", gc.Compress(file));
                    }
                }
            }

        }
    }
}
